package com.lcf.demo;

public class Vehicle {
//    定义属性
    private int speed;
    private double size;
//    构造函数
    public Vehicle() {
    }

    public Vehicle(int speed, double size) {
        this.speed = speed;
        this.size = size;
    }


//    构造set和set


    public int getSpeed() {
        return speed;
    }

    public double getSize() {
        return size;
    }

    public void setSize(double size) {
        this.size = size;
    }
    public void move(){
        System.out.println(" Vehicle is moving  at   speed = " + speed);
    }
public void setSpeed(int speed){
this.speed=speed;
}
public void speedUp(){
this.speed+=10;
}
public void speedDown(){
if(this.speed>0){
     this.speed -=10;
}
}

}
